<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			document.body.addEventListener('touchmove', function(e) {
			  if (e._isScroller) return;
			  // 阻止默认事件
			  e.preventDefault();
			}, {
			  passive: false
			});
		},
		onShow: function() {
			window['send'] = (link) => {
			  var i = document.createElement('iframe');
			  i.style.display = 'none';
			  i.onload = function () {
			    i.parentNode?.removeChild(i);
			  };
			  i.src = link;
			  document.body.appendChild(i);
			  setTimeout(() => {
			    i.src = 'about:blank';
			    i.parentNode?.removeChild(i);
			  }, 100);
			}
			window['album'] = (type, data) => {
			  window['send'](`terms://album?type=${type}&data=${data}`)
			}
			window['photo'] = (type) => {
			  window['send'](`terms://photo?type=${type}`)
			}
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>
